import Vue from 'vue'
import Vuex from 'vuex'
import user from './user'
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [createPersistedState()],
  state: {
  },
  getters: {
  },
  mutations: {
  // 更新token
  // 参数1: 永远都是 state
  // 参数2：payload 载荷
    updateToken (state, token) {
      state.token = token
    }
  },
  actions: {
  },
  modules: {
    user
  }
})
